$categoryArray, 'brandArray' => $brandArray); } /** * Get Brand Info * @author: clifton * @date: 14/04/2021 */ function GetBrandInfoByBrandList($brand) { global $config, $inventoryPDO; $sql = "SELECT * FROM brands WHERE brandlist='" . $brand . "'"; $cmd = $inventoryPDO->prepare($sql); $cmd->execute(); $brandCount = $cmd->rowCount(); if ($brandCount > 0) return $row = $cmd->fetch(PDO::FETCH_OBJ); else return; } /** * Get Category Info * @author: clifton * @date: 14/04/2021 */ function GetCatInfoByCatList($cat) { global $config, $inventoryPDO; $sql = "SELECT * FROM category WHERE category_list='" . $cat . "'"; $cmd = $inventoryPDO->prepare($sql); $cmd->execute(); $brandCount = $cmd->rowCount(); if ($brandCount > 0) return $row = $cmd->fetch(PDO::FETCH_OBJ); else return; } function GetRelatedBrands($brand, $showOriginalBrand = TRUE) { global $config, $inventoryPDO; $prefix = $config->cat_brand_prefix; if ($prefix == "") { $prefix = "en_"; } else { $prefix .= "_"; } $sql = "SELECT brands1." . $config->cat_brand_prefix . "brandlist AS relatedBrand1Name, brands1." . $prefix . "alias AS alias1, brands1." . $prefix . "url AS url1, brands2." . $config->cat_brand_prefix . "brandlist AS relatedBrand2Name, brands2." . $prefix . "alias AS alias2, brands2." . $prefix . "url AS url2, brands3." . $config->cat_brand_prefix . "brandlist AS relatedBrand3Name, brands3." . $prefix . "alias AS alias3, brands3." . $prefix . "url AS url3, brands." . $prefix . "alias AS alias, brands." . $prefix . "url AS url, brands." . $config->cat_brand_prefix . "brandlist AS brandLang, brands.* FROM brands join brands as brands1 on brands.relatedbrand1 = brands1.id join brands as brands2 on brands.relatedbrand2 = brands2.id join brands as brands3 on brands.relatedbrand3 = brands3.id WHERE brands.brandlist = '" . $brand . "'"; $stmt = $inventoryPDO->prepare($sql); $stmt->execute(); $relatedBrand = $stmt->fetchObject(); $isFirst = true; if ($stmt->rowCount() > 0 && (strlen($brand) > 0 || strlen($relatedBrand->relatedBrand1Name) > 0 || strlen($relatedBrand->relatedBrand2Name) > 0 || strlen($relatedBrand->relatedBrand3Name) > 0)) { $brandLang = $relatedBrand->brandLang; if (isset($relatedBrand->url) && strlen($relatedBrand->url) > 0) { $url = $relatedBrand->url; } else { $url = "machinebrandview.php?mybrand=" . $brand; } if (isset($relatedBrand->url1) && strlen($relatedBrand->url1) > 0) { $url1 = $relatedBrand->url1; } else { $url1 = "machinebrandview.php?mybrand=" . $relatedBrand->relatedBrand1Name; } if (isset($relatedBrand->url2) && strlen($relatedBrand->url2) > 0) { $url2 = $relatedBrand->url2; } else { $url2 = "machinebrandview.php?mybrand=" . $relatedBrand->relatedBrand2Name; } if (isset($relatedBrand->url3) && strlen($relatedBrand->url3) > 0) { $url3 = $relatedBrand->url3; } else { $url3 = "machinebrandview.php?mybrand=" . $relatedBrand->relatedBrand3Name; } if (isset($relatedBrand->alias) && strlen($relatedBrand->alias) > 0) { $alias = $relatedBrand->alias; } else { $alias = $brandLang; } if (isset($relatedBrand->alias1) && strlen($relatedBrand->alias1) > 0) { $alias1 = $relatedBrand->alias1; } else { $alias1 = $relatedBrand->relatedBrand1Name; } if (isset($relatedBrand->alias2) && strlen($relatedBrand->alias2) > 0) { $alias2 = $relatedBrand->alias2; } else { $alias2 = $relatedBrand->relatedBrand2Name; } if (isset($relatedBrand->alias3) && strlen($relatedBrand->alias3) > 0) { $alias3 = $relatedBrand->alias3; } else { $alias3 = $relatedBrand->relatedBrand3Name; } $result = ""; $result .= "
\n"; $result .= "" . GetTranslation("consider") . ": "; if ($showOriginalBrand) { $isFirst = false; $result .= "" . $alias . ""; } if ($relatedBrand->relatedbrand1 != 0) { if ($showOriginalBrand) $result .= ", "; $result .= "" . $alias1 . ""; } if ($relatedBrand->relatedbrand2 != 0) { $result .= ", " . $alias2 . ""; } if ($relatedBrand->relatedbrand3 != 0) { $result .= ", " . $alias3 . "\n"; } $result .= "
"; return $result; } } function GetBrandURL($brand, $useAlias = true, $newWindow = false) { global $config, $inventoryPDO; $prefix = $config->cat_brand_prefix; if ($prefix == "") { $prefix = "en_"; } else { $prefix .= "_"; } $sql = "SELECT " . $prefix . "alias AS alias, " . $prefix . "url AS url FROM brands WHERE brandlist = '" . $brand . "'"; $cmd = $inventoryPDO->prepare($sql); $cmd->execute(); $brandCount = $cmd->rowCount(); if ($brandCount > 0) { $row = $cmd->fetch(PDO::FETCH_OBJ); if ($newWindow) { $newWindowText = 'target="_blank"'; } else { $newWindowText = ''; } if (isset($row->url) && (strlen($row->url) > 0)) { if ($useAlias) { $url = "" . $row->alias . ""; } else { $url = "" . $brand . ""; } } else { $url = "" . $brand . ""; } } else { $url = $brand; } return $url; } function GetBrandURLSimple($brand, $useAlias = true, $newWindow = false) { global $config, $inventoryPDO; $prefix = $config->cat_brand_prefix; if ($prefix == "") { $prefix = "en_"; } else { $prefix .= "_"; } $sql = "SELECT " . $prefix . "alias AS alias, " . $prefix . "url AS url FROM brands WHERE brandlist = '" . $brand . "'"; $cmd = $inventoryPDO->prepare($sql); $cmd->execute(); $brandCount = $cmd->rowCount(); if ($brandCount > 0) { $row = $cmd->fetch(PDO::FETCH_OBJ); if ($newWindow) { $newWindowText = 'target="_blank"'; } else { $newWindowText = ''; } if (isset($row->url) && (strlen($row->url) > 0)) { if ($useAlias) { $url = $row->url; } else { $url = $row->url; } } else { $url = "machinebrandview.php?mybrand=" . $brand; } } else { $url = $brand; } return $url; } function GetCategoryURL($category, $useAlias = true, $newWindow = false) { global $config, $inventoryPDO; $prefix = $config->cat_brand_prefix; $newWindowText = ''; if ($prefix == "") { $prefix = "en_"; } else { $prefix .= "_"; } $sql = "SELECT " . $prefix . "alias AS alias, " . $prefix . "url AS url FROM category WHERE category_list = '" . $category . "'"; $cmd = $inventoryPDO->prepare($sql); $cmd->execute(); $categoryCount = $cmd->rowCount(); if ($categoryCount > 0) { $row = $cmd->fetch(PDO::FETCH_OBJ); if (isset($row->url) && strlen($row->url) > 0) { if ($newWindow) { $newWindowText = 'target="_blank"'; } if ($useAlias && strlen($row->alias) > 0) { $url = "" . $row->alias . ""; } else { $url = "" . $category . ""; } } else { $url = "" . $category . ""; } } else { $url = $category; } return $url; } function GetCategoryURLSimple($category, $useAlias = true, $newWindow = false) { global $config, $inventoryPDO; $prefix = $config->cat_brand_prefix; $newWindowText = ''; if ($prefix == "") { $prefix = "en_"; } else { $prefix .= "_"; } $sql = "SELECT " . $prefix . "alias AS alias, " . $prefix . "url AS url FROM category WHERE category_list = '" . $category . "'"; $cmd = $inventoryPDO->prepare($sql); $cmd->execute(); $categoryCount = $cmd->rowCount(); if ($categoryCount > 0) { $row = $cmd->fetch(PDO::FETCH_OBJ); if (isset($row->url) && strlen($row->url) > 0) { if ($newWindow) { $newWindowText = 'target="_blank"'; } if ($useAlias && strlen($row->alias) > 0) { $url = $row->url; } else { $url = $row->url; } } else { $url = "used_diecasting_equipment.php?mycat=" . $category; } } else { $url = $category; } return $url; } function GetRelatedCategories($category, $showOriginalCategory = TRUE) { global $config, $inventoryDb; $prifix = $config->cat_brand_prefix; if (!isset($prefix) || $prefix == "") { $prefix = "en_"; } else { $prefix .= "_"; } $sql = "SELECT cat.*, cat." . $config->cat_brand_prefix . "category_list AS categoryLang, cat." . $prefix . "alias AS alias, cat." . $prefix . "url AS url, cat1." . $config->cat_brand_prefix . "category_list AS relatedCategory1Name, cat1." . $prefix . "alias AS alias1, cat1." . $prefix . "url AS url1, cat2." . $config->cat_brand_prefix . "category_list AS relatedCategory2Name, cat2." . $prefix . "alias AS alias2, cat2." . $prefix . "url AS url2, cat3." . $config->cat_brand_prefix . "category_list AS relatedCategory3Name, cat3." . $prefix . "alias AS alias3, cat3." . $prefix . "url AS url3 FROM category AS cat left outer join category AS cat1 on cat.relatedcategory1 = cat1.id left outer join category AS cat2 on cat.relatedcategory2 = cat2.id left outer join category AS cat3 on cat.relatedcategory3 = cat3.id WHERE cat.category_list = '" . $category . "'"; //echo $sql; $categoryQuery = $inventoryDb->query($sql); $categoryResult = $categoryQuery->fetch_object(); if (isset($categoryResult)) { $categoryLang = $categoryResult->categoryLang; if ((strlen($categoryLang) > 0 && $showOriginalCategory) || strlen($categoryResult->relatedCategory1Name) > 0 || strlen($categoryResult->relatedCategory2Name) > 0 || strlen($categoryResult->relatedCategory3Name) > 0) { if (isset($categoryResult->url) && strlen($categoryResult->url) > 0) { $url = $categoryResult->url; } else { $url = "used_diecasting_equipment.php?mycat=" . $category; } if (isset($categoryResult->url1) && strlen($categoryResult->url1) > 0) { $url1 = $categoryResult->url1; } else { $url1 = "used_diecasting_equipment.php?mycat=" . $categoryResult->relatedCategory1Name; } if (isset($categoryResult->url2) && strlen($categoryResult->url2) > 0) { $url2 = $categoryResult->url2; } else { $url2 = "used_diecasting_equipment.php?mycat=" . $categoryResult->relatedCategory2Name; } if (isset($categoryResult->url3) && strlen($categoryResult->url3) > 0) { $url3 = $categoryResult->url3; } else { $url3 = "used_diecasting_equipment.php?mycat=" . $categoryResult->relatedCategory3Name; } if (isset($categoryResult->alias) && strlen($categoryResult->alias) > 0) { $alias = $categoryResult->alias; } else { $alias = $categoryLang; } if (isset($categoryResult->alias1) && strlen($categoryResult->alias1) > 0) { $alias1 = $categoryResult->alias1; } else { $alias1 = $categoryResult->relatedCategory1Name; } if (isset($categoryResult->alias2) && strlen($categoryResult->alias2) > 0) { $alias2 = $categoryResult->alias2; } else { $alias2 = $categoryResult->relatedCategory2Name; } if (isset($categoryResult->alias3) && strlen($categoryResult->alias3) > 0) { $alias3 = $categoryResult->alias3; } else { $alias3 = $categoryResult->relatedCategory3Name; } $result = ""; $result .= "
\n"; $result .= "" . GetTranslation("consider") . ": "; if ($showOriginalCategory) { $result .= "" . $alias . ""; } if ($categoryResult->relatedcategory1 != 0) { if ($showOriginalCategory) $result .= ", "; $result .= "" . $alias1 . ""; } if ($categoryResult->relatedcategory2 != 0) { $result .= ", " . $alias2 . ""; } if ($categoryResult->relatedcategory3 != 0) { // $result .= ", " . $alias3 . "\n"; } $result .= "
"; return $result; } } else { return ""; } } function GetRelatedCategoriesSimple($wherestring, $returnQty, $based, $language = 'EN') { global $config, $inventoryDb; $lang = new Language(); $prefix = $config->cat_brand_prefix; $aliasLanguagePrefix = "en_"; if (!isset($prefix) || $prefix == "") { $prefix = "en_"; } else { $prefix .= "_"; } //$language ='ES'; if ($lang->getLanguageSession() == "ES" or $language == 'ES') { $aliasLanguagePrefix = "sp_"; $prefix = 'sp_'; } if ($based == "brand") { $sql = "SELECT cat1." . $config->cat_brand_prefix . "category_list AS relatedCategoryName4, cat1." . $aliasLanguagePrefix . "alias AS alias4, cat1." . $prefix . "url AS url4, cat2." . $config->cat_brand_prefix . "category_list AS relatedCategoryName2, cat2." . $aliasLanguagePrefix . "alias AS alias2, cat2." . $prefix . "url AS url2, cat3." . $config->cat_brand_prefix . "category_list AS relatedCategoryName3, cat3." . $aliasLanguagePrefix . "alias AS alias3, cat3." . $prefix . "url AS url3, cat4." . $config->cat_brand_prefix . "category_list AS relatedCategoryName1, cat4." . $aliasLanguagePrefix . "alias AS alias1, cat4." . $prefix . "url AS url1 FROM brands left outer join category AS cat1 on brands.relatedcategory1 = cat1.id left outer join category AS cat2 on brands.relatedcategory2 = cat2.id left outer join category AS cat3 on brands.relatedcategory3 = cat3.id left outer join category AS cat4 on brands.relatedcategory4 = cat4.id WHERE brands.brandlist = '" . $wherestring . "'"; } elseif ($based == "category") { $sql = "SELECT cat1." . $config->cat_brand_prefix . "category_list AS relatedCategoryName4, cat1." . $aliasLanguagePrefix . "alias AS alias4, cat1." . $prefix . "url AS url4, cat2." . $config->cat_brand_prefix . "category_list AS relatedCategoryName2, cat2." . $aliasLanguagePrefix . "alias AS alias2, cat2." . $prefix . "url AS url2, cat3." . $config->cat_brand_prefix . "category_list AS relatedCategoryName3, cat3." . $aliasLanguagePrefix . "alias AS alias3, cat3." . $prefix . "url AS url3, cat." . $config->cat_brand_prefix . "category_list AS relatedCategoryName1, cat." . $aliasLanguagePrefix . "alias AS alias1, cat." . $prefix . "url AS url1 FROM category as cat left outer join category AS cat1 on cat.relatedcategory1 = cat1.id left outer join category AS cat2 on cat.relatedcategory2 = cat2.id left outer join category AS cat3 on cat.relatedcategory3 = cat3.id WHERE cat.category_list = '" . $wherestring . "'"; //echo $sql; } elseif ($based == "item") { //item query here } //echo $sql;die; $categoryQuery = $inventoryDb->query($sql); $categoryResult = $categoryQuery->fetch_object(); if (isset($categoryResult)) { //if we are showing the source category, let's add it first. $i = 0; // if($showOriginalCategory){ // $categoryArray[] = array("name" => ChooseCategoryLabel($categoryResult->categoryLang,$categoryResult->alias), "url" => $categoryResult->url); // $i = 1; //we need to advance this by 1 // } for ($i = $i; $i < $returnQty + 1; $i++) { $catName = "relatedCategoryName" . $i; $alias = "alias" . $i; $url = "url" . $i; if (isset($categoryResult->$url) && (isset($categoryResult->$catName))) { $categoryArray[] = array("name" => ChooseCategoryLabel($categoryResult->$catName, $categoryResult->$alias), "url" => $categoryResult->$url); } } //var_dump($categoryArray); return array($categoryArray); } } function ChooseCategoryLabel($categoryName, $categoryAlias) { $return = $categoryName; if (isset($categoryAlias) && strlen($categoryAlias) > 0) { $return = $categoryAlias; } return $return; } //GetRelatedBrandsSimple //Author: Matthew Penn //Date: July 25, 2018 //Summary: This "GetRelatedBrands" function bases it's query on the passed in Category, instead of brand. //This query matches the older related sidebar better. function GetRelatedBrandsSimple($wherestring, $returnQty, $based, $lang = 'EN') { global $config, $inventoryDb; $lang = new Language(); //$wherestring = $inventoryDb->real_escape_string($wherestring); $prefix = $config->cat_brand_prefix; if (!isset($prefix) || $prefix == "") { $prefix = "en_"; } else { $prefix .= "_"; } if ($lang->getLanguageSession() == "ES" or $lang == 'ES') { $alias = 'sp_alias'; //$brandlist = 'spbrandlist'; //to-do add in spanish brand names when they are finished populating. $url = 'sp_url'; } else { $url = 'en_url'; //$brandlist = 'brandlist'; $alias = 'en_alias'; } if ($based == "brand") { $sql = " SELECT brands1.brandlist AS relatedBrandName4, brands1.$alias AS alias4, brands1.$url AS url4, brands2.brandlist AS relatedBrandName2, brands2.$alias AS alias2, brands2.$url AS url2, brands3.brandlist AS relatedBrandName3, brands3.$alias AS alias3, brands3.$url AS url3, brands.$alias AS alias1, brands.$url AS url1, brands.brandlist AS relatedBrandName1 FROM brands JOIN brands AS brands1 ON brands.relatedbrand1 = brands1.id JOIN brands AS brands2 ON brands.relatedbrand2 = brands2.id JOIN brands AS brands3 ON brands.relatedbrand3 = brands3.id WHERE brands.brandlist = '" . $wherestring . "'"; //echo $sql; } elseif ($based == "category") { $sql = "SELECT brands1." . $config->cat_brand_prefix . "brandlist AS relatedBrandName4, brands1." . $prefix . "alias AS alias4, brands1." . $prefix . "url AS url4, brands2." . $config->cat_brand_prefix . "brandlist AS relatedBrandName2, brands2." . $prefix . "alias AS alias2, brands2." . $prefix . "url AS url2, brands3." . $config->cat_brand_prefix . "brandlist AS relatedBrandName3, brands3." . $prefix . "alias AS alias3, brands3." . $prefix . "url AS url3, brands4." . $config->cat_brand_prefix . "brandlist AS relatedBrandName1, brands4." . $prefix . "alias AS alias1, brands4." . $prefix . "url AS url1 FROM category as cat join brands as brands1 on cat.relatedbrand1 = brands1.id join brands as brands2 on cat.relatedbrand2 = brands2.id join brands as brands3 on cat.relatedbrand3 = brands3.id join brands as brands4 on cat.relatedbrand4 = brands4.id WHERE cat.category_list = '" . $wherestring . "'"; //echo $sql; } elseif ($based == "item") { echo "item query here"; } $brandQuery = $inventoryDb->query($sql); $brandResult = $brandQuery->fetch_object(); if (isset($brandResult)) { //if we are showing the source category, let's add it first. $i = 0; for ($i = $i; $i < $returnQty + 1; $i++) { $brandName = "relatedBrandName" . $i; $alias = "alias" . $i; $url = "url" . $i; if (isset($brandResult->$url) && (isset($brandResult->$brandName))) { $brandArray[] = array("name" => ChooseCategoryLabel($brandResult->$brandName, $brandResult->$alias), "url" => $brandResult->$url); } } return array($brandArray); } } function GetItemUrl($itemId, $lang = 'EN') { global $inventoryPDO; $url = ""; if ($lang == "ES") { $size_unit = "size_unit_es"; $suffix = "_es"; } else { $size_unit = "size_unit"; $suffix = ""; } if (isset($itemId)) { //$sqlQuery = "SELECT id, brand, model, $size_unit AS size_unit, list1 FROM inven WHERE id = :id"; $sqlQuery = " SELECT inven.id, brand, model, $size_unit AS size_unit, list1, category.spcategory_list FROM inven LEFT JOIN category ON inven.list1 = category.category_list WHERE inven.id = :id"; $stmt = $inventoryPDO->prepare($sqlQuery); $stmt->bindParam(":id", $itemId); $stmt->execute(); $item = $stmt->fetch(PDO::FETCH_OBJ); $brand = $item->brand; $size = $item->model; $sizeUnit = $item->size_unit; if ($lang == "ES") { $cat = $item->spcategory_list; } else { $cat = $item->list1; } $url = "id"; $url .= "_" . $itemId; $url .= "_" . $brand; $url .= "_" . str_replace("#", "", $size); $url .= "_" . $sizeUnit; $url .= "_" . $cat; $url .= $suffix; $url = str_replace(" ", "+", $url); $url = str_replace("/", "+", $url); return $url; } else { return false; } } function CreateItemPDFrfq($itemId, $quotePrice, $quoteId, $includeSearchAssistText = true) { ini_set("memory_limit", "128M"); error_log('CreateItemPDFrfq for ' . $itemId . 'for ' . $quotePrice); global $config, $pdfFilepath2; $filePath = $_SERVER['DOCUMENT_ROOT'] . $pdfFilepath2; $uid = md5(uniqid(time())); $filename = 'DieCastMachinery-' . $itemId . "-" . $uid . '.pdf'; ob_clean(); $mpdf = new \Mpdf\Mpdf(); //$mpdf = new mPDF('', 'Letter', 0, '', 13, 13, 0, 13, 10, 10); $mpdf->packTableData = true; //added DEc. 29 2016 $htmlHeader = ''; $htmlHeader .= ''; $htmlHeader .= ''; $htmlHeader .= '

www.diecastmachinery.com
3246 West Monroe Street
Waukegan, IL 60085-3029 USA
1-847-360-9170 Phone
1-847-360-9189 Fax

'; $mpdf->SetHTMLHeader($htmlHeader); $mpdf->pagenumPrefix = 'Page '; $mpdf->pagenumSuffix = ' '; $mpdf->nbpgPrefix = ' of '; $mpdf->nbpgSuffix = ''; $htmlFooter = ''; $htmlFooter .= ''; $htmlFooter .= ''; $htmlFooter .= ''; $htmlFooter .= '
www.diecastmachinery.com{PAGENO}{nbpg}
'; $mpdf->SetHTMLFooter("
" . $htmlFooter); include_once("functions.itemprint.inc.php"); //for printing product PDFs - Matt Added 4/29/2016 $itemHtml = GetItemHtml4PrintPagePDF($itemId, true, $quotePrice, $includeSearchAssistText); $mpdf->WriteHTML($itemHtml); $mpdf->Output($filePath . $filename); error_log($filename); return $filename; } function ReturnItemData($itemId) { global $inventoryDb, $detect, $purchaseAgreement, $config; $debug = false; //$sql = "SELECT * FROM inven WHERE id = " . $itemId; $sql = "SELECT * FROM inven LEFT JOIN inven_machine_type ON inven.machine_type_id = inven_machine_type.id WHERE inven.id = $itemId"; $machineQuery = $inventoryDb->query($sql); $machineResult = $machineQuery->fetch_object(); $result = get_object_vars($machineResult); return $result; } function ReturnSeoData($itemId) { global $inventoryDb, $detect, $purchaseAgreement, $config; $itemSEO = InventoryPatternMerge($itemId, false); //var_dump($itemSEO); //die; $result = get_object_vars($itemSEO); return $result; //var_dump($result); } function GetItemCategory($itemId, $lang = 'EN') { global $inventoryDb; $sql = "SELECT list1 FROM inven WHERE id = " . $itemId; $machineQuery = $inventoryDb->query($sql); $machineResult = $machineQuery->fetch_object(); $result = get_object_vars($machineResult); $list1 = $machineResult->list1; return $list1; } function GetItemBrand2($itemId) { global $inventoryDb; $sql = "SELECT brand FROM inven WHERE id = " . $itemId; $machineQuery = $inventoryDb->query($sql); $machineResult = $machineQuery->fetch_object(); $result = $machineResult->brand; return $result; } function CategorySellBoxYN($category) { global $inventoryDb; $sql = "SELECT sellboxYN, sellboxURL, sellboxText FROM category WHERE category_list = '" . $category . "'"; $machineQuery = $inventoryDb->query($sql); $machineResult = $machineQuery->fetch_object(); return $machineResult; } /* function GetItemBrand ($itemId) { global $inventoryDb; $sql = "SELECT brand FROM inven WHERE id = " . $itemId; $machineQuery = $inventoryDb->query($sql); $machineResult = $machineQuery->fetch_object(); $result = get_object_vars($machineResult); $brand = $machineResult->brand; return $list1; } */ function GetItemHtmlDisplay($itemId, $quotePrice) { global $inventoryDb, $inventoryImagesPath, $infoEmail, $webaddress, $purchaseAgreement, $config; $merge = InventoryPatternMerge($itemId, false); $sql = "SELECT * FROM inven WHERE id = " . $itemId; $machineQuery = $inventoryDb->query($sql); $machineResult = $machineQuery->fetch_object(); $result = get_object_vars($machineResult); // Section Titles $titleSpecifications = GetTranslation("item-title-specifications"); $titleMeasurements = GetTranslation("item-title-measurements"); $titleOptionalEquip = GetTranslation("item-title-optional-equipment"); $titleTermsOfSale = GetTranslation("item-title-terms-of-sale"); $titleDescription = GetTranslation("item-title-description"); $titleFeaturesAccessories = GetTranslation("item-title-features-and-accessories"); $titleDocuments = GetTranslation("item-title-documents"); $titleCADDocuments = GetTranslation("item-title-cad-documents"); $titlePrice = GetTranslation("item-title-price"); $titleShippingTerms = GetTranslation("item-title-shipping-terms"); $titleIdPrefix = GetTranslation("item-title-id-prefix"); $titleStatus = GetTranslation("item-title-status"); $titleStatusAvailable = GetTranslation("item-title-status-available"); $titleStatusSold = GetTranslation("item-title-status-sold"); $titleClickImage = GetTranslation("item-title-click-image"); $titleForSale = GetTranslation("we_offer_for_sale"); $shortdesc = $merge->short_desc; //$machineResult->shortdesc; $catdesc = $merge->catalog_desc; //$machineResult->catdesc; $title1 = $merge->title_line1; //$machineResult->title1; $title2 = $merge->title_line2; //$machineResult->title2; $title3 = $machineResult->title3; $searchAssisstTitle = GetTranslation("item-title-search-assist"); $feature1 = $machineResult->feature1; $feature2 = $machineResult->feature2; $feature3 = $machineResult->feature3; $feature4 = $machineResult->feature4; $feature5 = $machineResult->feature5; $feature6 = $machineResult->feature6; $id = $machineResult->id; $picid = $machineResult->id; $contact1 = $machineResult->contact1; $contactid = $machineResult->contactid; $sellparty1 = $machineResult->sellparty1; $sellpartyid = $machineResult->sellpartyid; $jointventure = $machineResult->jointventure; $jointventureid = $machineResult->jointventureid; $jointpercent = $machineResult->jointpercent; $list1 = $machineResult->list1; $list2 = $machineResult->list2; $list3 = $machineResult->list3; $list4 = $machineResult->list4; $list5 = $machineResult->list5; $list6 = $machineResult->list6; $list7 = $machineResult->list7; $list8 = $machineResult->list8; $status = $machineResult->status; $shipterms = $machineResult->shipterms; $saletype = $machineResult->saletype; $stockdate = $machineResult->stockdate; $askprice = $machineResult->askprice; $minprice = $machineResult->minprice; $quoteprice = $machineResult->quoteprice; $soldprice = $machineResult->soldprice; $solddate = $machineResult->solddate; $soldtocontact = $machineResult->soldtocontact; $soldtoid = $machineResult->soldtoid; $brand = $machineResult->brand; $model = $machineResult->model; $showweb = $machineResult->showweb; $privatenotes = $machineResult->privatenotes; $catalogshow = $machineResult->catalogshow; $spectext1 = $machineResult->spectext1; $spectext2 = $machineResult->spectext2; $spectext3 = $machineResult->spectext3; $spectext4 = $machineResult->spectext4; $spectext5 = $machineResult->spectext5; $spectext6 = $machineResult->spectext6; $spectext7 = $machineResult->spectext7; $spectext8 = $machineResult->spectext8; $spectext9 = $machineResult->spectext9; $spectext10 = $machineResult->spectext10; $spectext11 = $machineResult->spectext11; $spectext12 = $machineResult->spectext12; $specus1 = $machineResult->specus1; $specus2 = $machineResult->specus2; $specus3 = $machineResult->specus3; $specus4 = $machineResult->specus4; $specus5 = $machineResult->specus5; $specus6 = $machineResult->specus6; $specus7 = $machineResult->specus7; $specus8 = $machineResult->specus8; $specus9 = $machineResult->specus9; $specus10 = $machineResult->specus10; $specus11 = $machineResult->specus11; $specus12 = $machineResult->specus12; $specmetric1 = $machineResult->specmetric1; $specmetric2 = $machineResult->specmetric2; $specmetric3 = $machineResult->specmetric3; $specmetric4 = $machineResult->specmetric4; $specmetric5 = $machineResult->specmetric5; $specmetric6 = $machineResult->specmetric6; $specmetric7 = $machineResult->specmetric7; $specmetric8 = $machineResult->specmetric8; $specmetric9 = $machineResult->specmetric9; $specmetric10 = $machineResult->specmetric10; $specmetric11 = $machineResult->specmetric11; $specmetric12 = $machineResult->specmetric12; $pictures = $machineResult->pictures; $webprice = $machineResult->webprice; $webpricedesc = $machineResult->webpricedesc; $contacttest = $machineResult->contacttest; $boxlength = $machineResult->boxlength; $boxwidth = $machineResult->boxwidth; $boxsqft = $machineResult->boxsqft; $warehousedate = $machineResult->warehousedate; $datepurchased = $machineResult->datepurchased; $pricepaid = $machineResult->pricepaid; $rigging = $machineResult->rigging; $optionalequip1 = $machineResult->optionalequip1; $optionalequip2 = $machineResult->optionalequip2; $optionalequip3 = $machineResult->optionalequip3; $optionalequip4 = $machineResult->optionalequip4; $optionalequip5 = $machineResult->optionalequip5; $optionalequip6 = $machineResult->optionalequip6; $optionalequiplink1 = $machineResult->optionalequiplink1; $optionalequiplink2 = $machineResult->optionalequiplink2; $optionalequiplink3 = $machineResult->optionalequiplink3; $optionalequiplink4 = $machineResult->optionalequiplink4; $optionalequiplink5 = $machineResult->optionalequiplink5; $optionalequiplink6 = $machineResult->optionalequiplink6; if ($status == "Available") { $status = "" . $titleStatusAvailable . ""; } else { $status = "" . $titleStatusSold . ""; } $tableHeaderColor = "#5A5B5B"; $tableHeaderTextColor = "#FFFFFF"; $tableCellColor1 = "#DAD8D8"; $tableCellColor2 = "#FFE157"; $itemHtml = "\n"; $itemHtml .= "\n" . '' . "\n"; $itemHtml .= '' . "\n"; if (strlen($titleForSale) > 0) { $itemHtml .= '' . "\n"; } if (strlen($title1) > 0) { $itemHtml .= '' . "\n"; } if (strlen($title2) > 0) { $itemHtml .= '' . "\n"; } if (strlen($title3) > 0) { $itemHtml .= '' . "\n"; } $itemHtml .= '' . "\n"; if (strlen($spectext1) > 0) { $itemHtml .= '' . "\n"; $itemHtml .= '' . "\n"; for ($i = 1; $i < 13; $i++) { if (strlen($result["spectext" . $i])) { $itemHtml .= '' . "\n"; $itemHtml .= '' . "\n"; } } } if (strlen($result["feature1"]) > 0) { $itemHtml .= '' . "\n"; for ($i = 1; $i < 13; $i++) { if (strlen($result["feature" . $i])) { $itemHtml .= '' . "\n"; } } } if ( strlen($result["optionalequip1"]) > 0 || strlen($result["optionalequip2"]) > 0 || strlen($result["optionalequip3"]) > 0 || strlen($result["optionalequip4"]) > 0 || strlen($result["optionalequip5"]) > 0 || strlen($result["optionalequip6"]) > 0 ) { $itemHtml .= '' . "\n"; for ($i = 1; $i < 13; $i++) { if (strlen($result["optionalequip" . $i]) > 0) { $itemHtml .= '' . "\n"; } } } // *** PDF DOCUMENTS ROW *** if (itemHasFilesWithExtension($itemId, ".pdf")) { $fileQuery = GetAttachedFiles($itemId); $itemHtml .= '' . "\n"; while ($file = $fileQuery->fetch_object()) { if (endsWith($file->file_name, ".pdf")) { $itemHtml .= '' . "\n"; } } } // *** CAD DOCUMENTS ROW *** if (itemHasFilesWithExtension($itemId, ".skp")) { $fileQuery = GetAttachedFiles($itemId); $itemHtml .= '' . "\n"; $itemHtml .= '' . "\n"; while ($file = $fileQuery->fetch_object()) { if (endsWith($file->file_name, ".skp")) { $itemHtml .= '' . "\n"; } } } // *** TERMS OF SALE *** $itemHtml .= '' . "\n"; if ($webprice) { $itemHtml .= '' . "\n"; } else { //$itemHtml .= '' . "\n"; $itemHtml .= '' . "\n"; } $itemHtml .= '' . "\n"; $itemHtml .= '
' . $titleIdPrefix . ' ' . $id . '
' . $titleForSale . '

' . $title1 . '

' . $title2 . '

' . $title3 . '

' . $titleStatus . ' ' . $status . '
' . $titleSpecifications . '' . $titleMeasurements . '
' . $result["spectext" . $i] . '' . $result["specmetric" . $i] . ' / ' . $result["specus" . $i] . '
' . $titleFeaturesAccessories . '
' . $result["feature" . $i] . '
' . $titleOptionalEquip . '
' . $result["optionalequip" . $i] . '
' . $titleDocuments . '
' . $file->file_name . '
' . $titleCADDocuments . 'Download Google SketchUp
' . $file->file_name . '
' . $titleTermsOfSale . '
' . $titlePrice . ' ' . $askprice . '
' . $titlePrice . ' request quotation
' . $titlePrice . ' request quotation
' . $titleShippingTerms . ' ' . $shipterms . "\n"; $itemHtml .= "

" . $merge->international_shipping . '

' . "\n"; if (isset($machineResult->youtube) && strlen($machineResult->youtube) > 0) { $itemHtml .= "
" . $machineResult->youtube . "
" . "\n"; } if ($machineResult->pictures == "yes") { $itemHtml .= "
\n"; $itemHtml .= "
\n"; $itemHtml .= "
" . $titleClickImage . "
" . "\n
\n"; for ($i = 1; $i < 25; $i = $i + 2) { $picUrl = $config->inventoryImagesPath; $picFilename1 = $id . '-' . $i . '.jpg'; $picFilename2 = $id . '-' . ($i + 1) . '.jpg'; $pic1Exists = false; if (file_exists("." . $config->inventoryImagesPath . $picFilename1) || file_exists("../.." . $config->inventoryImagesPath . $picFilename1) || file_exists(".." . $config->inventoryImagesPath . $picFilename1)) { $pic1Exists = true; $itemHtml .= ""; $itemHtml .= '' . $shortdesc . ' used 1' . "\n  \n"; } if (file_exists("." . $config->inventoryImagesPath . $picFilename2) || file_exists("../.." . $config->inventoryImagesPath . $picFilename2) || file_exists(".." . $config->inventoryImagesPath . $picFilename2)) { $itemHtml .= ""; $itemHtml .= '' . $shortdesc . ' used 1' . "\n"; } } $itemHtml .= "
\n"; $itemHtml .= "
\n"; $itemHtml .= "
\n"; } $itemHtml .= "

" . $titleDescription . $catdesc . "
" . "\n"; if (strlen($merge->search_assist) > 0) { $itemHtml .= "
"; $itemHtml .= $searchAssisstTitle . $merge->search_assist; $itemHtml .= "
" . "\n"; } $itemHtml .= "
"; $itemHtml .= '

' . $purchaseAgreement . '

'; $itemHtml .= "
" . "\n"; $itemHtml .= "\n"; return $itemHtml; } function InventoryPatternMerge($id, $debug) { global $inventoryDb, $config, $inventoryPDO; $itemSEO = new ItemSeoObj(); $itemSEO->seo_page_title = ""; $itemSEO->pdf_title = ""; $itemSEO->pdf_subject = ""; $itemSEO->pdf_keywords = ""; $itemSEO->seo_meta_desc = ""; $itemSEO->seo_meta_keywords = ""; $itemSEO->seo_meta_header = ""; $itemSEO->seo_meta_footer = ""; $itemSEO->short_desc = ""; $itemSEO->catalog_desc = ""; $itemSEO->search_assist = ""; $itemSEO->international_shipping = ""; $itemSEO->title_line1 = ""; $itemSEO->title_line2 = ""; $itemSEO->title_line3 = ""; $itemSEO->picture_page_title = ""; $itemSEO->picture_meta_desc = ""; $itemSEO->picture_meta_header = ""; $itemSEO->picture_meta_keywords = ""; $itemSEO->picture_1_alt_text = ""; $itemSEO->picture_2_alt_text = ""; $itemSEO->picture_3_alt_text = ""; $itemSEO->picture_4_alt_text = ""; $itemSEO->picture_5_alt_text = ""; $itemSEO->picture_6_alt_text = ""; $itemSEO->picture_caption = ""; $itemSEO->item_size = ""; $sqlQuery = "SELECT inven_machine_type_category.name as category, inven_machine_type.short_desc, inven_machine_type.long_desc, inven.* FROM inven left outer join inven_machine_type on inven.machine_type_id = inven_machine_type.id left outer join inven_machine_type_category on inven_machine_type.category_id = inven_machine_type_category.id WHERE inven.id = " . $id; // error_log($sqlQuery); $stmt = $inventoryPDO->prepare($sqlQuery); $stmt->execute(); $item = $stmt->fetch(PDO::FETCH_BOTH); if (!isset($item)) return $itemSEO; $sqlQuery = "SELECT * FROM inven_global_patterns WHERE id=1"; $stmt = $inventoryPDO->prepare($sqlQuery); $stmt->execute(); $patterns = $stmt->fetch(PDO::FETCH_BOTH); if (!isset($patterns)) { return $itemSEO; } $useMachineType = $item["use_machine_type"]; if (!isset($useMachineType) || $useMachineType == 0) { // Pattern codes $itemSEO->seo_page_title_code = "[page_title]"; $itemSEO->pdf_title_code = "[pdf_title]"; $itemSEO->pdf_subject_code = "[pdf_subject]"; $itemSEO->pdf_keywords_code = "[pdf_keywords]"; $itemSEO->pdf_title = $item["page_title"]; $itemSEO->pdf_subject = $item["meta_desc"]; $itemSEO->pdf_keywords = $item["meta_keywords"]; $itemSEO->seo_meta_desc_code = "[meta_desc]"; $itemSEO->seo_meta_keywords_code = "[meta_keywords]"; $itemSEO->seo_meta_header_code = "[head_alt_tag]"; $itemSEO->seo_meta_footer_code = ""; $itemSEO->short_desc_code = "[shortdesc]"; $itemSEO->catalog_desc_code = "[catdesc]"; $itemSEO->search_assist_code = ""; $itemSEO->international_shipping_code = ""; $itemSEO->title_line1_code = "[title1]"; $itemSEO->title_line2_code = "[title2]"; $itemSEO->title_line3_code = "[title3]"; $itemSEO->picture_page_title_code = "[page_title]"; $itemSEO->picture_meta_desc_code = "[head_alt_tag]"; $itemSEO->picture_meta_header_code = "[head_alt_tag]"; $itemSEO->picture_meta_keywords_code = "[meta_keywords]"; $itemSEO->picture_1_alt_text_code = "[shortdesc]"; $itemSEO->picture_2_alt_text_code = "[shortdesc]"; $itemSEO->picture_3_alt_text_code = "[shortdesc]"; $itemSEO->picture_4_alt_text_code = "[shortdesc]"; $itemSEO->picture_5_alt_text_code = "[shortdesc]"; $itemSEO->picture_6_alt_text_code = "[shortdesc]"; $itemSEO->picture_caption_code = ""; $itemSEO->seo_page_title = $item["page_title"]; $itemSEO->seo_meta_desc = $item["meta_desc"]; $itemSEO->seo_meta_keywords = $item["meta_keywords"]; $itemSEO->seo_meta_header = $item["head_alt_tag"]; $itemSEO->seo_meta_footer = ""; $itemSEO->short_desc = $item["shortdesc"]; $itemSEO->catalog_desc = $item["catdesc"]; $itemSEO->search_assist = ""; $itemSEO->international_shipping = ""; $itemSEO->title_line1 = $item["title1"]; $itemSEO->title_line2 = $item["title2"]; $itemSEO->title_line3 = $item["title3"]; $itemSEO->picture_page_title = $item["meta_desc"]; $itemSEO->picture_meta_desc = $item["meta_desc"]; $itemSEO->picture_meta_header = $item["head_alt_tag"]; $itemSEO->picture_meta_keywords = $item["meta_keywords"]; $itemSEO->picture_1_alt_text = $item["shortdesc"]; $itemSEO->picture_2_alt_text = $item["shortdesc"]; $itemSEO->picture_3_alt_text = $item["shortdesc"]; $itemSEO->picture_4_alt_text = $item["shortdesc"]; $itemSEO->picture_5_alt_text = $item["shortdesc"]; $itemSEO->picture_6_alt_text = $item["shortdesc"]; $itemSEO->picture_caption = $item["meta_keywords"]; $itemSEO->item_size = $item["model"] . " " . $item['size_unit']; } else { // Pattern codes $itemSEO->seo_page_title_code = $patterns["seo_page_title"]; $itemSEO->pdf_title_code = $patterns["pdf_title"]; $itemSEO->pdf_subject_code = $patterns["pdf_subject"]; $itemSEO->pdf_keywords_code = $patterns["pdf_keywords"]; $itemSEO->seo_meta_desc_code = $patterns["seo_meta_desc"]; $itemSEO->seo_meta_keywords_code = $patterns["seo_meta_keywords"]; $itemSEO->seo_meta_header_code = $patterns["seo_meta_header"]; $itemSEO->seo_meta_footer_code = $patterns["seo_meta_footer"]; $itemSEO->short_desc_code = $patterns["short_desc"]; $itemSEO->catalog_desc_code = $patterns["catalog_desc"]; $itemSEO->search_assist_code = $patterns["search_assist"]; $itemSEO->international_shipping_code = $patterns["international_shipping"]; $itemSEO->title_line1_code = $patterns["title_line1"]; $itemSEO->title_line2_code = $patterns["title_line2"]; $itemSEO->title_line3_code = $patterns["title_line3"]; $itemSEO->picture_page_title_code = $patterns["picture_page_title"]; $itemSEO->picture_meta_desc_code = $patterns["picture_meta_desc"]; $itemSEO->picture_meta_header_code = $patterns["picture_meta_header"]; $itemSEO->picture_meta_keywords_code = $patterns["picture_meta_keywords"]; $itemSEO->picture_1_alt_text_code = $patterns["picture_1_alt_text"]; $itemSEO->picture_2_alt_text_code = $patterns["picture_2_alt_text"]; $itemSEO->picture_3_alt_text_code = $patterns["picture_3_alt_text"]; $itemSEO->picture_4_alt_text_code = $patterns["picture_4_alt_text"]; $itemSEO->picture_5_alt_text_code = $patterns["picture_5_alt_text"]; $itemSEO->picture_6_alt_text_code = $patterns["picture_6_alt_text"]; $itemSEO->picture_caption_code = $patterns["picture_caption"]; // Replace [column_name] $itemSEO->seo_page_title = SubInvenTableColumns($patterns["seo_page_title"], $item, $debug); $itemSEO->pdf_title = SubInvenTableColumns($patterns["pdf_title"], $item, $debug); $itemSEO->pdf_subject = SubInvenTableColumns($patterns["pdf_subject"], $item, $debug); $itemSEO->pdf_keywords = SubInvenTableColumns($patterns["pdf_keywords"], $item, $debug); $itemSEO->seo_meta_desc = SubInvenTableColumns($patterns["seo_meta_desc"], $item, $debug); $itemSEO->seo_meta_keywords = SubInvenTableColumns($patterns["seo_meta_keywords"], $item, $debug); $itemSEO->seo_meta_header = SubInvenTableColumns($patterns["seo_meta_header"], $item, $debug); $itemSEO->seo_meta_footer = SubInvenTableColumns($patterns["seo_meta_footer"], $item, $debug); $itemSEO->short_desc = SubInvenTableColumns($patterns["short_desc"], $item, $debug); $itemSEO->catalog_desc = SubInvenTableColumns($patterns["catalog_desc"], $item, $debug); $itemSEO->search_assist = SubInvenTableColumns($patterns["search_assist"], $item, $debug); $itemSEO->international_shipping = SubInvenTableColumns($patterns["international_shipping"], $item, $debug); $itemSEO->title_line1 = SubInvenTableColumns($patterns["title_line1"], $item, $debug); $itemSEO->title_line2 = SubInvenTableColumns($patterns["title_line2"], $item, $debug); $itemSEO->title_line3 = SubInvenTableColumns($patterns["title_line3"], $item, $debug); $itemSEO->picture_page_title = SubInvenTableColumns($patterns["picture_page_title"], $item, $debug); $itemSEO->picture_meta_desc = SubInvenTableColumns($patterns["picture_meta_desc"], $item, $debug); $itemSEO->picture_meta_header = SubInvenTableColumns($patterns["picture_meta_header"], $item, $debug); $itemSEO->picture_meta_keywords = SubInvenTableColumns($patterns["picture_meta_keywords"], $item, $debug); $itemSEO->picture_1_alt_text = SubInvenTableColumns($patterns["picture_1_alt_text"], $item, $debug); $itemSEO->picture_2_alt_text = SubInvenTableColumns($patterns["picture_2_alt_text"], $item, $debug); $itemSEO->picture_3_alt_text = SubInvenTableColumns($patterns["picture_3_alt_text"], $item, $debug); $itemSEO->picture_4_alt_text = SubInvenTableColumns($patterns["picture_4_alt_text"], $item, $debug); $itemSEO->picture_5_alt_text = SubInvenTableColumns($patterns["picture_5_alt_text"], $item, $debug); $itemSEO->picture_6_alt_text = SubInvenTableColumns($patterns["picture_6_alt_text"], $item, $debug); $itemSEO->picture_caption = SubInvenTableColumns($patterns["picture_caption"], $item, $debug); // Replace {translation_text} $itemSEO->seo_page_title = SubTranslations($itemSEO->seo_page_title, $debug); $itemSEO->pdf_title = SubTranslations($itemSEO->pdf_title, $debug); $itemSEO->pdf_subject = SubTranslations($itemSEO->pdf_subject, $debug); $itemSEO->pdf_keywords = SubTranslations($itemSEO->pdf_keywords, $debug); $itemSEO->seo_meta_desc = SubTranslations($itemSEO->seo_meta_desc, $debug); $itemSEO->seo_meta_keywords = SubTranslations($itemSEO->seo_meta_keywords, $debug); $itemSEO->seo_meta_header = SubTranslations($itemSEO->seo_meta_header, $debug); $itemSEO->seo_meta_footer = SubTranslations($itemSEO->seo_meta_footer, $debug); $itemSEO->short_desc = SubTranslations($itemSEO->short_desc, $debug); $itemSEO->catalog_desc = SubTranslations($itemSEO->catalog_desc, $debug); $itemSEO->search_assist = SubTranslations($itemSEO->search_assist, $debug); $itemSEO->international_shipping = SubTranslations($itemSEO->international_shipping, $debug); $itemSEO->title_line1 = SubTranslations($itemSEO->title_line1, $debug); $itemSEO->title_line2 = SubTranslations($itemSEO->title_line2, $debug); $itemSEO->title_line3 = SubTranslations($itemSEO->title_line3, $debug); $itemSEO->picture_page_title = SubTranslations($itemSEO->picture_page_title, $debug); $itemSEO->picture_meta_desc = SubTranslations($itemSEO->picture_meta_desc, $debug); $itemSEO->picture_meta_header = SubTranslations($itemSEO->picture_meta_header, $debug); $itemSEO->picture_meta_keywords = SubTranslations($itemSEO->picture_meta_keywords, $debug); $itemSEO->picture_1_alt_text = SubTranslations($itemSEO->picture_1_alt_text, $debug); $itemSEO->picture_2_alt_text = SubTranslations($itemSEO->picture_2_alt_text, $debug); $itemSEO->picture_3_alt_text = SubTranslations($itemSEO->picture_3_alt_text, $debug); $itemSEO->picture_4_alt_text = SubTranslations($itemSEO->picture_4_alt_text, $debug); $itemSEO->picture_5_alt_text = SubTranslations($itemSEO->picture_5_alt_text, $debug); $itemSEO->picture_6_alt_text = SubTranslations($itemSEO->picture_6_alt_text, $debug); $itemSEO->picture_caption = SubTranslations($itemSEO->picture_caption, $debug); if (isset($item["model"])) { $itemSEO->item_size = $item["model"] . " " . $item['size_unit']; } if ($debug) { $leftBracket = '('; $rightBracket = ')'; } else { $leftBracket = ""; $rightBracket = ""; } // Replace (Machine_Type_Long) $itemSEO->seo_page_title = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->seo_page_title); $itemSEO->pdf_title = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->pdf_title); //$itemSEO->pdf_subject = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->pdf_subject); //$itemSEO->pdf_keywords = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->pdf_keywords); $itemSEO->seo_meta_desc = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->seo_meta_desc); $itemSEO->seo_meta_keywords = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->seo_meta_keywords); $itemSEO->seo_meta_header = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->seo_meta_header); $itemSEO->seo_meta_footer = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->seo_meta_footer); $itemSEO->short_desc = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->short_desc); $itemSEO->catalog_desc = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->catalog_desc); $itemSEO->search_assist = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->search_assist); $itemSEO->international_shipping = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->international_shipping); $itemSEO->title_line1 = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->title_line1); $itemSEO->title_line2 = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->title_line2); $itemSEO->title_line3 = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->title_line3); $itemSEO->picture_page_title = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->picture_page_title); $itemSEO->picture_meta_desc = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->picture_meta_desc); $itemSEO->picture_meta_header = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->picture_meta_header); $itemSEO->picture_meta_keywords = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->picture_meta_keywords); $itemSEO->picture_1_alt_text = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->picture_1_alt_text); $itemSEO->picture_2_alt_text = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->picture_2_alt_text); $itemSEO->picture_3_alt_text = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->picture_3_alt_text); $itemSEO->picture_4_alt_text = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->picture_4_alt_text); $itemSEO->picture_5_alt_text = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->picture_5_alt_text); $itemSEO->picture_6_alt_text = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->picture_6_alt_text); $itemSEO->picture_caption = str_replace("(Machine_Type_Long)", $leftBracket . $item["long_desc"] . $rightBracket, $itemSEO->picture_caption); // Replace (Machine_Type_Short) $itemSEO->seo_page_title = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->seo_page_title); //$itemSEO->pdf_title = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->pdf_title); //$itemSEO->pdf_subject = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->pdf_subject); //$itemSEO->pdf_keywords = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->pdf_keywords); $itemSEO->seo_meta_desc = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->seo_meta_desc); $itemSEO->seo_meta_keywords = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->seo_meta_keywords); $itemSEO->seo_meta_header = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->seo_meta_header); $itemSEO->seo_meta_footer = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->seo_meta_footer); $itemSEO->short_desc = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->short_desc); $itemSEO->catalog_desc = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->catalog_desc); $itemSEO->search_assist = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->search_assist); $itemSEO->international_shipping = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->international_shipping); $itemSEO->title_line1 = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->title_line1); $itemSEO->title_line2 = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->title_line2); $itemSEO->title_line3 = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->title_line3); $itemSEO->picture_page_title = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->picture_page_title); $itemSEO->picture_meta_desc = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->picture_meta_desc); $itemSEO->picture_meta_header = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->picture_meta_header); $itemSEO->picture_meta_keywords = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->picture_meta_keywords); $itemSEO->picture_1_alt_text = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->picture_1_alt_text); $itemSEO->picture_2_alt_text = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->picture_2_alt_text); $itemSEO->picture_3_alt_text = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->picture_3_alt_text); $itemSEO->picture_4_alt_text = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->picture_4_alt_text); $itemSEO->picture_5_alt_text = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->picture_5_alt_text); $itemSEO->picture_6_alt_text = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->picture_6_alt_text); $itemSEO->picture_caption = str_replace("(Machine_Type_Short)", $leftBracket . $item["short_desc"] . $rightBracket, $itemSEO->picture_caption); } return $itemSEO; } function SubInvenTableColumns($pattern, $item, $debug) { $returnString = ""; if ($debug) { $leftBracket = '['; $rightBracket = ']'; } else { $leftBracket = ""; $rightBracket = ""; } $patternArray = explode("[", $pattern); if (count($patternArray) > 1) { $arrayCount = 0; foreach ($patternArray as $text) { if ($arrayCount != 0) { $column = substr($text, 0, strpos($text, "]")); $returnString .= $leftBracket . $item[$column] . $rightBracket . substr($text, strpos($text, "]") + 1); } else { if (substr($pattern, 0, 0) == "[") { $column = substr($text, 0, strpos($text, "]")); $returnString .= $leftBracket . $item[$column] . $rightBracket . substr($text, strpos($text, "]") + 1); } else { $returnString .= $text; } } $arrayCount++; } return $returnString; } else { return $pattern; } } function SubTranslations($pattern, $debug) { $returnString = ""; if ($debug) { $leftBracket = '{'; $rightBracket = '}'; } else { $leftBracket = ""; $rightBracket = ""; } $patternArray = explode("{", $pattern); if (count($patternArray) > 1) { $arrayCount = 0; foreach ($patternArray as $text) { if ($arrayCount != 0) { $subKey = substr($text, 0, strpos($text, "}")); $returnString .= $leftBracket . GetInvenTranslation($subKey) . $rightBracket . substr($text, strpos($text, "}") + 1); } else { if (substr($pattern, 0, 0) == "{") { $subKey = substr($text, 0, strpos($text, "}") - 1); $returnString .= $leftBracket . GetInvenTranslation($subKey) . $rightBracket . substr($text, strpos($text, "}") + 1); } else { $returnString .= $text; } } $arrayCount++; } return $returnString; } else { return $pattern; } } function GetInvenTranslation($key) { global $inventoryPDO, $config; $sqlQuery = "SELECT * FROM inven_general_terms WHERE shortname = '" . $key . "'"; $stmt = $inventoryPDO->prepare($sqlQuery); $stmt->execute(); $row = $stmt->fetch(); return $row[$config->country_code] ?? ''; } function GetItemHtmlrfq($itemId, $isPdf, $quotePrice) { global $inventoryDb, $detect, $purchaseAgreement, $config; //echo "Item ID: ".$itemId; $merge = InventoryPatternMerge($itemId, false); $sql = "SELECT * FROM inven WHERE id = " . $itemId; $machineQuery = $inventoryDb->query($sql); $machineResult = $machineQuery->fetch_object(); $result = get_object_vars($machineResult); // if ($config->country_code != "en-US") { // $prefix = $config->country_code . "_"; // } else { // $prefix = ""; // } // Section Titles $titleSpecifications = GetTranslation("item-title-specifications"); $titleMeasurements = GetTranslation("item-title-measurements"); $titleOptionalEquip = GetTranslation("item-title-optional-equipment"); $titleTermsOfSale = GetTranslation("item-title-terms-of-sale"); $titleDescription = GetTranslation("item-title-description"); $titleFeaturesAccessories = GetTranslation("item-title-features-and-accessories"); $titleDocuments = GetTranslation("item-title-documents"); $titleCADDocuments = GetTranslation("item-title-cad-documents"); $titlePrice = GetTranslation("item-title-price"); $titleShippingTerms = GetTranslation("item-title-shipping-terms"); $titleIdPrefix = GetTranslation("item-title-id-prefix"); $titleStatus = GetTranslation("item-title-status"); $titleStatusAvailable = GetTranslation("item-title-status-available"); $titleStatusSold = GetTranslation("item-title-status-sold"); $titleClickImage = GetTranslation("item-title-click-image"); $shortdesc = $merge->short_desc; //$machineResult->shortdesc; $catdesc = $merge->catalog_desc; //$machineResult->catdesc; $titleForSale = GetTranslation("we_offer_for_sale"); $title1 = $merge->title_line1; //$machineResult->title1; $title2 = $merge->title_line2; //$machineResult->title2; $title3 = $machineResult->title3; $searchAssisstTitle = GetTranslation("item-title-search-assist"); $feature1 = $machineResult->feature1; $feature2 = $machineResult->feature2; $feature3 = $machineResult->feature3; $feature4 = $machineResult->feature4; $feature5 = $machineResult->feature5; $feature6 = $machineResult->feature6; $id = $machineResult->id; $picid = $machineResult->id; $contact1 = $machineResult->contact1; $contactid = $machineResult->contactid; $sellparty1 = $machineResult->sellparty1; $sellpartyid = $machineResult->sellpartyid; $jointventure = $machineResult->jointventure; $jointventureid = $machineResult->jointventureid; $jointpercent = $machineResult->jointpercent; $list1 = $machineResult->list1; $list2 = $machineResult->list2; $list3 = $machineResult->list3; $list4 = $machineResult->list4; $list5 = $machineResult->list5; $list6 = $machineResult->list6; $list7 = $machineResult->list7; $list8 = $machineResult->list8; $status = $machineResult->status; $shipterms = $machineResult->shipterms; $saletype = $machineResult->saletype; $stockdate = $machineResult->stockdate; $askprice = $machineResult->askprice; $minprice = $machineResult->minprice; $quoteprice = $machineResult->quoteprice; $soldprice = $machineResult->soldprice; $solddate = $machineResult->solddate; $soldtocontact = $machineResult->soldtocontact; $soldtoid = $machineResult->soldtoid; $brand = $machineResult->brand; $model = $machineResult->model; $showweb = $machineResult->showweb; $privatenotes = $machineResult->privatenotes; $catalogshow = $machineResult->catalogshow; $spectext1 = $machineResult->spectext1; $spectext2 = $machineResult->spectext2; $spectext3 = $machineResult->spectext3; $spectext4 = $machineResult->spectext4; $spectext5 = $machineResult->spectext5; $spectext6 = $machineResult->spectext6; $spectext7 = $machineResult->spectext7; $spectext8 = $machineResult->spectext8; $spectext9 = $machineResult->spectext9; $spectext10 = $machineResult->spectext10; $spectext11 = $machineResult->spectext11; $spectext12 = $machineResult->spectext12; $specus1 = $machineResult->specus1; $specus2 = $machineResult->specus2; $specus3 = $machineResult->specus3; $specus4 = $machineResult->specus4; $specus5 = $machineResult->specus5; $specus6 = $machineResult->specus6; $specus7 = $machineResult->specus7; $specus8 = $machineResult->specus8; $specus9 = $machineResult->specus9; $specus10 = $machineResult->specus10; $specus11 = $machineResult->specus11; $specus12 = $machineResult->specus12; $specmetric1 = $machineResult->specmetric1; $specmetric2 = $machineResult->specmetric2; $specmetric3 = $machineResult->specmetric3; $specmetric4 = $machineResult->specmetric4; $specmetric5 = $machineResult->specmetric5; $specmetric6 = $machineResult->specmetric6; $specmetric7 = $machineResult->specmetric7; $specmetric8 = $machineResult->specmetric8; $specmetric9 = $machineResult->specmetric9; $specmetric10 = $machineResult->specmetric10; $specmetric11 = $machineResult->specmetric11; $specmetric12 = $machineResult->specmetric12; $pictures = $machineResult->pictures; $webprice = $machineResult->webprice; $webpricedesc = $machineResult->webpricedesc; $contacttest = $machineResult->contacttest; $boxlength = $machineResult->boxlength; $boxwidth = $machineResult->boxwidth; $boxsqft = $machineResult->boxsqft; $warehousedate = $machineResult->warehousedate; $datepurchased = $machineResult->datepurchased; $pricepaid = $machineResult->pricepaid; $rigging = $machineResult->rigging; $optionalequip1 = $machineResult->optionalequip1; $optionalequip2 = $machineResult->optionalequip2; $optionalequip3 = $machineResult->optionalequip3; $optionalequip4 = $machineResult->optionalequip4; $optionalequip5 = $machineResult->optionalequip5; $optionalequip6 = $machineResult->optionalequip6; $optionalequiplink1 = $machineResult->optionalequiplink1; $optionalequiplink2 = $machineResult->optionalequiplink2; $optionalequiplink3 = $machineResult->optionalequiplink3; $optionalequiplink4 = $machineResult->optionalequiplink4; $optionalequiplink5 = $machineResult->optionalequiplink5; $optionalequiplink6 = $machineResult->optionalequiplink6; if ($status == "Available") { //$status = $titleStatusAvailable; $status = "" . $titleStatusAvailable . ""; } else { $status = "" . $titleStatusSold . ""; } $tableHeaderColor = "#5A5B5B"; $tableHeaderTextColor = "#FFFFFF"; $tableCellColor1 = "#DAD8D8"; $tableCellColor2 = "#FFE157"; // $arr = get_defined_vars(); // echo '
';
//    print_r($arr);
//    echo '
'; // die; $itemHtml = ""; if (!$isPdf) { $itemHtml .= "\n\n"; $itemHtml .= '' . "\n\n"; $itemHtml .= '
' . "\n"; $itemHtml .= ' ' . $list1 . '' . "\n"; $itemHtml .= ' ' . $title2 . '' . "\n"; $itemHtml .= ' ' . "\n"; $itemHtml .= ' ' . $title1 . '' . "\n"; $itemHtml .= ' Inventory #: ' . $id . '' . "\n"; $itemHtml .= ' Condition: Used' . "\n"; $itemHtml .= ''; $itemHtml .= ' status == 'Available') ? 'href="http://schema.org/InStock"' : 'href="http://schema.org/OutOfStock"') . '/>' . $status . "\n"; // $itemHtml .= ' '; $itemHtml .= ''; if ($machineResult->pictures == "yes") { $itemHtml .= ' ' . $shortdesc . ' used 1' . "\n"; } $itemHtml .= '
' . "\n"; $itemHtml .= "\n\n"; } $itemHtml .= "\n" . '' . "\n"; // USED FOR INDEPENDENT PDF GENERATTION // $itemHtml .= '' . "\n"; $itemHtml .= '' . "\n"; if (strlen($titleForSale) > 0) { if ($isPdf) { $itemHtml .= '' . "\n"; } else { $itemHtml .= '' . "\n"; } } if (strlen($title1) > 0) { if ($isPdf) { $itemHtml .= '' . "\n"; } else { $itemHtml .= '' . "\n"; } } if (strlen($title2) > 0) { if ($isPdf) { $itemHtml .= '' . "\n"; } else { $itemHtml .= '' . "\n"; } } if (strlen($title3) > 0) { if ($isPdf) { $itemHtml .= '' . "\n"; } else { $itemHtml .= '' . "\n"; } // } else if (strlen($shortdesc) > 0) { // $itemHtml .= '' . "\n"; } $itemHtml .= '' . "\n"; if (strlen($spectext1) > 0) { $itemHtml .= '' . "\n"; $itemHtml .= '' . "\n"; for ($i = 1; $i < 13; $i++) { if (strlen($result["spectext" . $i])) { $itemHtml .= '' . "\n"; $itemHtml .= '' . "\n"; } } } if (strlen($result["feature1"]) > 0) { $itemHtml .= '' . "\n"; for ($i = 1; $i < 13; $i++) { if (strlen($result["feature" . $i])) { $itemHtml .= '' . "\n"; } } } if ( strlen($result["optionalequip1"]) > 0 || strlen($result["optionalequip2"]) > 0 || strlen($result["optionalequip3"]) > 0 || strlen($result["optionalequip4"]) > 0 || strlen($result["optionalequip5"]) > 0 || strlen($result["optionalequip6"]) > 0 ) { $itemHtml .= '' . "\n"; for ($i = 1; $i < 13; $i++) { if (strlen($result["optionalequip" . $i]) > 0) { $itemHtml .= '' . "\n"; } } } // *** PDF DOCUMENTS ROW *** if (itemHasFilesWithExtension($itemId, ".pdf")) { $fileQuery = GetAttachedFiles($itemId); $itemHtml .= '' . "\n"; while ($file = $fileQuery->fetch_object()) { if (endsWith($file->file_name, ".pdf")) { $itemHtml .= '' . "\n"; } } } // *** CAD DOCUMENTS ROW *** if (itemHasFilesWithExtension($itemId, ".skp")) { $fileQuery = GetAttachedFiles($itemId); $itemHtml .= '' . "\n"; $itemHtml .= '' . "\n"; while ($file = $fileQuery->fetch_object()) { if (endsWith($file->file_name, ".skp")) { $itemHtml .= '' . "\n"; } } } // *** TERMS OF SALE *** $itemHtml .= '' . "\n"; if ($isPdf && $quotePrice != 'info') { $itemHtml .= '' . "\n"; } else if ($isPdf && $quotePrice == 'info') { //$itemHtml .= '' . "\n"; } else { if ($webprice) { $itemHtml .= '' . "\n"; } else { //$itemHtml .= '' . "\n"; $itemHtml .= '' . "\n"; } } $itemHtml .= '' . "\n"; $itemHtml .= '

Trim Press '.$id. '

' . $titleIdPrefix . ' ' . $id . '
' . $titleForSale . '
' . $titleForSale . '
' . $title1 . '

' . $title1 . '

' . $title2 . '

' . $title2 . '

' . $title3 . '

' . $title3 . '

Model: '.$shortdesc.'
' . $titleStatus . ' ' . $status . '
' . $titleSpecifications . '' . $titleMeasurements . '
' . $result["spectext" . $i] . '' . $result["specmetric" . $i] . ' / ' . $result["specus" . $i] . '
' . $titleFeaturesAccessories . '
' . $result["feature" . $i] . '
' . $titleOptionalEquip . '
' . $result["optionalequip" . $i] . '
' . $titleDocuments . '
' . $file->file_name . '
' . $titleCADDocuments . 'Download Google SketchUp
' . $file->file_name . '
' . $titleTermsOfSale . '
' . $titlePrice . ' ' . $quotePrice . '
'.$titlePrice.' request quotation
' . $titlePrice . ' ' . $askprice . '
' . $titlePrice . ' request quotation
' . $titlePrice . ' request quotation
' . $titleShippingTerms . ' ' . $shipterms . "\n"; $itemHtml .= "

" . $merge->international_shipping . '

' . "\n"; if (isset($machineResult->youtube) && strlen($machineResult->youtube) > 0) { $itemHtml .= '
'; $itemHtml .= "
" . $machineResult->youtube . "
" . "\n"; $itemHtml .= '
'; } if ($machineResult->pictures == "yes" and file_exists("machinepics/big/" . $id . "-1.jpg")) { if (!$isPdf) { $picUrl = $config->baseURLPictures . $config->inventoryImagesPath; $itemHtml .= ""; $itemHtml .= ""; //MATT DEMO $itemHtml .= ""; } else { //if this IS a PDF $itemHtml .= "
\n"; $itemHtml .= "
\n"; $itemHtml .= "
" . $titleClickImage . "
" . "\n
\n"; $picUrl = $config->baseURLPictures . $config->inventoryImagesPath; if ($detect->isMobile() && !$detect->isTablet()) { $picFilename1 = $id . '-1.jpg'; if (file_exists("." . $config->inventoryImagesPath . $picFilename1) || file_exists("../.." . $config->inventoryImagesPath . $picFilename1) || file_exists(".." . $config->inventoryImagesPath . $picFilename1)) { $pic1Exists = true; $itemHtml .= ""; $itemHtml .= '' . $shortdesc . ' used 1' . "\n  \n"; $itemHtml .= "More Images...\n"; } } else { for ($i = 1; $i < 25; $i = $i + 2) { $picFilename1 = $id . '-' . $i . '.jpg'; $picFilename2 = $id . '-' . ($i + 1) . '.jpg'; $pic1Exists = false; if (file_exists("." . $config->inventoryImagesPath . $picFilename1) || file_exists("../.." . $config->inventoryImagesPath . $picFilename1) || file_exists(".." . $config->inventoryImagesPath . $picFilename1)) { $pic1Exists = true; $itemHtml .= ""; $itemHtml .= '' . $shortdesc . ' used 1' . "\n  \n"; } if (file_exists("." . $config->inventoryImagesPath . $picFilename2) || file_exists("../.." . $config->inventoryImagesPath . $picFilename2) || file_exists(".." . $config->inventoryImagesPath . $picFilename2)) { $itemHtml .= ""; $itemHtml .= '' . $shortdesc . ' used 1' . "\n"; } } } $itemHtml .= "
\n"; $itemHtml .= "
\n"; $itemHtml .= "
\n"; } } $itemHtml .= "

" . $titleDescription . $catdesc . "
" . "\n"; if (strlen($merge->search_assist) > 0) { $itemHtml .= "
"; $itemHtml .= $searchAssisstTitle . $merge->search_assist; $itemHtml .= "
" . "\n"; } $itemHtml .= "

"; $itemHtml .= $purchaseAgreement; $itemHtml .= "

" . "\n"; return $itemHtml; } ?>
Warning: Cannot modify header information - headers already sent by (output started at /home/diecastm/public_html/includes/diecast/functions.itemdisplay.inc.php:1) in /home/diecastm/public_html/includes/diecast/functions.recent.items.inc.php on line 47

Warning: Cannot modify header information - headers already sent by (output started at /home/diecastm/public_html/includes/diecast/functions.itemdisplay.inc.php:1) in /home/diecastm/public_html/includes/diecast/functions.recent.items.inc.php on line 50
Used High Pressure Die Casting Machines and Equipment For Sale page_style == "") || ($pagerow->page_style == "Default")) { // echo ""; // } // if ($pagerow->page_style == "Single_Column") { // echo ""; // } // if ($pagerow->page_style == "Two_Column") { // echo ""; // } // if ($pagerow->page_style == "Three_Column") { // echo ""; // } // if ($pagerow->page_style == "Home") { // echo ""; // } ?>
 
World Leader in Used Die Casting Machinery!
menubar != "NO") { ?>

View All Categories and Types of Die Casting Machines
 
View All Available Melting, Holding and Heat Treat Furnaces by Type
 
Select Trim Presses, Die Cast Automation or Robots
 
Die Cast Process Control Solutions, X-Ray, Spectrometers, Vacuum Systems, Temperature-Control Units, Shot Monitoring, Laboratory
 
Select From Finishing Equipment including Shot Blast, Thermal-Deburring, Vibratory Finishing, Parts-Washers, Parts-Dryers or Environmental
 
Select from CNC Machining, DME-Tooling, and other Die Cast Support Equipment for your die cast factory needs
 


Why Do Business With Us?!

  • 60 years of experience buying and selling die casting machines, equipment and factories worldwide.
    • We buy and sell Cold Chamber Aluminum, Magnesium and Brass die casting machines; Hot Chamber Zinc, Zamak, Magnesium and Lead die casting machines.
    • Including 3-Platen, 2-Platen, Multi-Slide, IMA (Injected Metal Assembly)
  • We purchase quality used die casting machines and complete die casting factories world wide for cash.
    • We buy and sell all items used in the die casting process including trim presses, melting and holding furnaces, die casting automation (automatic ladles, die sprayers, extractors and robots); x-ray machines, spectrometers, shot blast and vibratory finishing equipment.
  • Die Cast Machinery, LLC has purchased and sold thousands of used die casting machines to more than 30 countries globally.
    • Hundreds of machines bought and sold to customers in Canada, Mexico, Brazil, Argentina, Germany, Spain, India, China, Korea, Brazil, Singapore and many other countries.
  • Used  Die Casting Machinery & Equipment is our specialty!
    • We are the global leader in procurement and sale of second hand die casting machines. If it exists in the world of die casting we have it or can find it.
  • We offer comprehensive services to our customers including:
    • Facility Appraisals, Financing, Factory Liquidations, Auctions and Sales of On-Going Businesses. We are a service orientated company that is dedicated to help you find the right machine for your application and budget.

Click here to view all of our inventory and use our fully automated RFQ system to receive your quotes in 2 minutes or less!

Why Do Business With Us?

60 Plus Years of Industry Experience

We buy and sell Cold Chamber Aluminum, Magnesium and Brass die casting machines; Hot Chamber Zinc, Zamak, Magnesium and Lead die casting machines worldwide

Cash For Your Machinery or Factory

We buy and sell worldwide all items used in the die casting process; trim presses, melting and holding furnaces, die cast automation, x-ray machines, spectrometers, shot blast and vibratory finishing equipment.

Thousands of Machines Bought & Sold

We have purchased and sold thousands of machines to more than 30 countries globally.  Hundreds of machines bought and sold to customers in Canada, Mexico, Brazil, Argentina, Germany, Spain, India, China, Korea, Brazil, Singapore and many other countries.

Die Casting Equipment is Our Specialty!

We are the global leader in procurement and sale of second hand die casting machines. If it exists in the world of die casting we have it or can find it.

Die Cast Machinery, LLC your source for die casting equipment solutions

Comprehensive services which include:

  • Facility Appraisals
  • Plant Liquidations
  • Auctions
  • Financing
  • Sales of On-Going Businesses.

We are a service orientated company that is dedicated to help you find the right machine for your application and budget.

 

Click here to view all of our inventory and use our fully automated RFQ system to receive your quotes in 2 minutes or less!


Buhler Evolution 120 DL Die Casting Machine for Sale
  • Buying Die Cast Equipment Worldwide
  • Die Cast Machinery & Plant Appraisal Services
  • Complete Die Cast Factory Liquidations and Auctions
  • Sales of your On-Going Die Cast Business
  • Cash Purchases - one die cast machine or entire factory
  • 60 years of die casting industry experience

We are the largest buyer and seller of Second Hand die cast machinery and equipment in the world, with over 60 years of experience and an intimate knowledge of the global market. Let us be your die casting machine source!